package fitnesse.wikitext.widgets;

import java.io.IOException;
import java.io.Reader;

import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.settings.MavenSettingsBuilder;
import org.apache.maven.settings.Settings;
import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;

public class MyMavenSettingsBuilder implements MavenSettingsBuilder {

	public Settings buildSettings(MavenExecutionRequest request)
			throws IOException, XmlPullParserException {

		Reader reader = ReaderFactory.newXmlReader(request
				.getUserSettingsFile());
		SettingsXpp3Reader modelReader = new SettingsXpp3Reader();
		return modelReader.read(reader);
	}

}
